home *** CD-ROM | disk | FTP | other *** search
/ Die Ultimative Software-P…i Collection 1996 & 1997 / Die Ultimative Software-Pakete CD-ROM fur Atari Collection 1996 & 1997.iso / p / pofo / text / prttxt / kbrass.txt < prev   
Encoding:
Text File  |  1991-08-22  |  7.8 KB  |  169 lines

  1.  
  2.         Reassigning Keystrokes on the Atari Portfolio
  3.                              by
  4.                          Carl Koop
  5.  
  6.         This files explains how to use the file ANSI.SYS, which
  7. can be found either here in the Portfolio SIG or in and DOS 2.0
  8. package, to create 'Hot Keys' so that any DOS command can be
  9. entered via a single keystroke or keystroke combination.  The
  10. information contained in this file is applicable, not only to
  11. the Portfolio, but to any DOS with an ANSI.SYS available for it.
  12. I hope that you find this information useful and should you 
  13. have any questions, I can be reached here on CompuServe.
  14.  
  15.         The ANSI.SYS file is an enhanced keyboard and display
  16. device driver which is available for DOS versions 2 and up. 
  17. One of the more useful functions of the ANSI.SYS device driver 
  18. is its ability to reassign values to individual keys on the
  19. keyboard.  This can be especially useful if you tend to execute
  20. the same programs very often as it will enable you to load and
  21. start these programs with a single keystroke, similar to 
  22. loading and starting the Portfolio's editor by pressing the 
  23. 'Atari' key and the 'E' keys simultaneously.
  24.  
  25.         In order to reassign keyboard values you must first 
  26. install ANSI.SYS into your system just as you would any other 
  27. installable device driver (be sure to use a DOS 2.0 compatible 
  28. ANSI.SYS file).  This is done by modifying your CONFIG.SYS 
  29. file so that the driver is installed automatically at boot 
  30. time.  For example, if your ANSI.SYS file is in your C:\DOS 
  31. directory you simply add the following statement to your 
  32. CONFIG.SYS file:
  33.  
  34.                    device=c:\dos\ansi.sys
  35.  
  36.         Remember that in order for ANSI.SYS to be installed, 
  37. and subsequently accessible, you must reboot after adding this 
  38. line to your CONFIG.SYS file.  Also worth remembering is that 
  39. while installing ANSI.SYS can enhance your usage of your 
  40. Portfolio, it will also use up some of the already precious, and
  41. somewhat limited memory available to you for program execution.
  42.  
  43.         Once ANSI.SYS has been installed into your system, you 
  44. can now reassign standard keystrokes to new values.  As is the 
  45. case with all ANSI.SYS command sequences, reassignment sequences
  46. begin with an ESC (escape character) followed by a left bracket
  47. ([).  The left bracket is followed by the ASCII code of the 
  48. character of the key that is to be reassigned.  This ASCII code 
  49. is then followed by one or more additional ASCII codes.  The 
  50. key indicated by the first ASCII code will take on the value of
  51. the remaining ASCII codes in the command sequence.  Each of the
  52. ASCII codes must be separated by a semicolon.  Finally, the 
  53. command sequence is terminated by a lower case 'p'.
  54.  
  55.         Before we get to an actual example, we must first learn
  56. how to enter an escape character into the command sequence 
  57. since simply hitting the ESC key will not issue the appropriate
  58. code (when you do enter an ESC keystroke DOS will intercept it
  59. and immediately perform the processing that it feels is 
  60. appropriate).  We will use the DOS command 'PROMPT' to issue 
  61. the escape sequence as that is the easiest method for our 
  62. purposes.  Now, finally, on to the example.
  63.  
  64.         Let's say that you want to be able to load and start a 
  65. program called 'XTERM2' with a single keystroke, 'F1'.  You 
  66. would issue the following commands at the DOS prompt:
  67.  
  68.                      prompt $e[0;59;"XTERM2";13p
  69.                      prompt
  70.  
  71.         The first line sends the command sequence, in this 
  72. case the ESC ($e), the left bracket, the ASCII code for F1 
  73. (0;59), the additional ASCII characters (we used a shortcut 
  74. and simply entered a double quoted string), the ASCII code 
  75. for a carriage return (13) and then terminated the command 
  76. with a lower case 'p'.  The second command resets the prompt 
  77. to the default.
  78.  
  79.         At this point you should be able to press 'F1' and 
  80. XTERM2 should load and start.  Pretty nice, huh?  But what 
  81. do you do if you want to pass a parameter through on the 
  82. command that starts your program?  Well since you probably do
  83. not want to set up a keystroke for every possible parameter 
  84. the best thing to do is eliminate the carriage return (13) 
  85. from the ANSI.SYS command sequence which will simply display
  86. the command to the screen when you press the appropriate 
  87. keystroke and then enter the parameter manually along with a
  88. carriage return.
  89.  
  90.         To make this whole operation as simple as possible, 
  91. you can create a batch file that contains all of the keyboard
  92. reassignment commands that you want to have and execute it 
  93. automatically at boot time.  The commands could just as easily
  94. be made a part of your standard AUTOEXEC.BAT file.
  95.  
  96.         There are a few items that you should keep in mind 
  97. when creating your own keyboard reassignment command 
  98. sequences.  First, when you issue a reassignment command 
  99. the key remains reassigned until you either reassign it
  100. again, or reboot your system, therefore be sure to select 
  101. keystrokes that you can afford to 'lose'.  For example, 
  102. many of the Portfolio's built in applications utilize F1 
  103. through F5, if you reassign F1 as we did in the example 
  104. above, even when you are in the editor, pressing F1 will 
  105. result in the string 'XTERM2' being issued and not the 
  106. standard F1 keystroke.  When I reassign my keyboard, I 
  107. typically use either the SHIFT or ALT keys in conjunction 
  108. with the function key to avoid problems.
  109.  
  110.         Second, if you add keyboard reassignment command 
  111. sequences to your AUTOEXEC.BAT file you will be forced 
  112. to rename the AUTOEXEC.BAT file and before you reboot if 
  113. you do not want the reassignments set up.  My remedy for 
  114. this is to keep a pair of .BAT files available on my C: 
  115. drive, one to install the reassignments, and one to remove
  116. them. This way all I have to do is execute the appropriate
  117. batch file on the fly.
  118.  
  119.         Finally, you should keep in mind that ANY keystroke 
  120. or combination of keystrokes can be reassigned.  This can be
  121. dangerous if you enter your reassignment command incorrectly,
  122. so I advise you to be careful whenever you are doing 
  123. reassignments.  I have included a small table that shows 
  124. the Extended ASCII codes for the various function key 
  125. settings for your convenience, but you can find all of the
  126. other ASCII codes in just about any DOS manual (and a lot of
  127. other places too).
  128.  
  129.         I hope that you find this information useful and
  130. enjoyable.  If you have any problems or questions regarding
  131. the use of the ANSI.SYS device driver for keyboard 
  132. reassignment, please feel free to contact me via Compuserve.
  133.  
  134.                                         Carl Koop
  135.                                         CIS ID: 73637,650
  136.  
  137.  
  138.  
  139.  
  140.                   Extended ASCII Codes 
  141.  
  142.      Key        Code           Key         Code
  143.  
  144.      F1         0,5            F2          0,60
  145.      F3         0,61           F4          0,62
  146.      F5         0,63           F6          0,64
  147.      F7         0,65           F8          0,66
  148.      F9         0,67           F10         0,68
  149.  
  150.      Shift/F1   0,84           Shift/F2    0,85
  151.      Shift/F3   0,86           Shift/F4    0,87
  152.      Shift/F5   0,88           Shift/F6    0,89
  153.      Shift/F7   0,90           Shift/F8    0,91
  154.      Shift/F9   0,92           Shift/F10   0,93
  155.  
  156.      Ctrl/F1    0,94           Ctrl/F2     0,95
  157.      Ctrl/F3    0,96           Ctrl/F4     0,97
  158.      Ctrl/F5    0,98           Ctrl/F6     0,99
  159.      Ctrl/F7    0,100          Ctrl/F8     0,101
  160.      Ctrl/F9    0,102          Ctrl/F10    0,103
  161.  
  162.      Alt/F1     0,104          Alt/F2      0,105
  163.      Alt/F3     0,106          Alt/F4      0,107
  164.      Alt/F5     0,108          Alt/F6      0,109
  165.      Alt/F7     0,110          Alt/F8      0,111
  166.      Alt/F9     0,112          Alt/F10     0,113
  167.  
  168.  
  169. əəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəəə